package main

import (
	"fmt"
	"github.com/golang-module/carbon/v2"
	"time"
)

func main() {
	fmt.Println(carbon.ParseByFormat("2024-02-01", "2006-01-02", carbon.PRC).Timestamp())
	fmt.Println(carbon.ParseByFormat("2025-01-31", "2006-01-02", carbon.PRC).Timestamp())
	return
	// 获取当前时间并显示（默认时区）
	fmt.Println("Current time (default timezone)1:", time.Now().String())
	fmt.Println("Current time (default timezone)21:", carbon.Now().ToString())
	fmt.Println("Current time (default timezone)22:", carbon.Now().Timestamp())

	fmt.Println("Current time (default timezone)31:", carbon.Now(carbon.UTC).ToString())
	fmt.Println("Current time (default timezone)32:", carbon.Now(carbon.UTC).Timestamp())

	return
	var (
		now  = carbon.Now(carbon.PRC)
		now1 = carbon.Now(carbon.PRC).StartOfDay()
		//start = "2024-03-01"
		end = "2024-07-19"
	)

	expiredDate := carbon.ParseByFormat(end, "2006-01-02", carbon.PRC)
	fmt.Println("now:", now.ToString())
	fmt.Println("now1:", now1.ToString())
	fmt.Println("expiredDate:", expiredDate.ToString())
	fmt.Println("DiffInDays:", expiredDate.DiffAbsInDays(now))
	fmt.Println("DiffInDays1:", expiredDate.DiffAbsInDays(now1))

	fmt.Println("now = carbon.Now(carbon.PRC)", carbon.Now().ToString())
	fmt.Println("now = carbon.Now(carbon.PRC)", carbon.Now().String())
	//// 获取当前时间并显示（东8区）
	//nowPRC := carbon.SetTimezone(carbon.PRC).Now()

	//fmt.Println("Current time (PRC timezone):", nowPRC.ToString())
}
